/*********************************************************************************
Organization 					: 				Georgia Institute of Technology
  
Institute 						:				Cognitive Computing Group(CCL)
 
Authors							: 				Santiago Ontanon, Kinshuk Mishra
 												Neha Sugandh 
 												
Class							:				ParallelPlan
 
Function						: 				Provides a Basic Operator Plan 
												for holding a plan for running in parallel
****************************************************************************/
package planninglanguage.plans;

import java.util.LinkedList;

import planninglanguage.conditions.Condition;


public class ParallelPlan extends MultiPlan {

	public ParallelPlan() {}
	
	public ParallelPlan(Condition a_precondition, Condition a_alivecondition, 
			Condition a_successcondition) {
		super(a_precondition, a_alivecondition, a_successcondition);
	}
	
	public void getOpenGoals(LinkedList<SubGoalPlan> openGoals) {
		for(Plan sp : this) {
			sp.getOpenGoals(openGoals);
		}
	}

	public void getTentativeActions(LinkedList<BasicOperatorPlan> tentativeActions) {
		for (Plan sp : this) {
			sp.getTentativeActions(tentativeActions);
		}
	}
	
	public void getExecutableActions(LinkedList<BasicOperatorPlan> executableActions) {
		for (Plan sp : this) {
			sp.getExecutableActions(executableActions);
		}
	}
	
	public void getExecutingIds(LinkedList<Integer> executingUnits) {
		for (Plan sp : this) {
			sp.getExecutingIds(executingUnits);
		}
	}
	
	protected String formatList(int idx) {
		return "No:" + idx + " ";
	}
}
